package com.warm.androidstudy.http;

import java.io.IOException;

import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

public class HeadIntercept implements Interceptor {
    @Override
    public Response intercept(Chain chain) throws IOException {
        Request ogg = chain.request();
        HttpUrl url=ogg
                .url()
                .newBuilder()
                .addQueryParameter("source","android")
                .build();
        Request request = ogg.newBuilder()
                .url(url)
                .addHeader("token", "")
                .addHeader("Content-Type","application/x-www-form-urlencoded")
                .build();

        return chain.proceed(request);
    }
}
